***** do-file "Appendix: Redistribution in a political Union", Citi & Justesen
sort id year
xtset id year 


**************
*** Appendix A: Summary statistics
xtsum OBB_GNI GNIpercapitaPPSEU15100 NationalUnemplymnetrate gini_net ssi govt_per108 left center right   
*************


**************
*** Appendix B: MFF fixed effects
* Reproduction of Table 1, models 1-4 with country fixed effects and MFF fixzed effects (no year fixed effects)
**************

*** Coding of multiannual financial framework (MFF)
* No MFF before 1988; first year of MFF is 1988

gen mff=.
label var mff "Multiannual financial framework (by period)"
replace mff = 0 if year<1988 // Baseline period, before mff
replace mff = 1 if year==1988 // mff1 1988-1992
replace mff = 1 if year==1989 // mff1 1988-1992
replace mff = 1 if year==1990
replace mff = 1 if year==1991
replace mff = 1 if year==1992
replace mff = 2 if year==1993 // mff2 1993-1999
replace mff = 2 if year==1994
replace mff = 2 if year==1995
replace mff = 2 if year==1996
replace mff = 2 if year==1997
replace mff = 2 if year==1998
replace mff = 2 if year==1999
replace mff = 3 if year==2000 // mff3 2000-2006 
replace mff = 3 if year==2001
replace mff = 3 if year==2002
replace mff = 3 if year==2003
replace mff = 3 if year==2004
replace mff = 3 if year==2005
replace mff = 3 if year==2006
replace mff = 4 if year==2007 // mff4 2007-2013
replace mff = 4 if year==2008
replace mff = 4 if year==2009
replace mff = 4 if year==2010
replace mff = 4 if year==2011
replace mff = 4 if year==2012
replace mff = 4 if year==2013
replace mff = 5 if year==2014 // mff5 2007-2013

* #1
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net ctr* i.mff
outreg2 using appB, tstat word bdec(2) tdec(2) replace

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net i.mff, fe


* #2: Add EU-level political variables
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 ctr* i.mff  
outreg2 using appB, tstat word bdec(2) tdec(2) append

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 i.mff, fe  
		

* #3: Add domestic political variables
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.center l.right ctr* i.mff   
outreg2 using appB, tstat word bdec(2) tdec(2) append

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.center l.right i.mff, fe   


* #4: All variables together
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 l.center l.right ctr* i.mff   
outreg2 using appB, tstat word bdec(2) tdec(2) append

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 l.center l.right i.mff, fe   
		
		
		
***************
*** Appendix C. EU Commission President fixed effects
***************

* Commission presidents // Jenkins serves as reference
gen jenkins = 0 // reference
replace jenkins = 1 if year>=1979 & year<1981

gen thorn = 0
replace thorn = 1 if year>=1981 & year<1985

gen delors = 0
replace delors = 1 if year>=1985 & year<1995

gen santer = 0
replace santer = 1 if year>=1995 & year<2000 // note Manuele Marin was acting president for 5 months after Santer resigned. We don't count Marin as Prez of Commission 

gen prodi = 0
replace prodi = 1 if year>=2000 & year<2005

gen barroso = 0
replace barroso = 1 if year>=2005 & year<2015


* #1
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net ctr* thorn-barroso
outreg2 using appC, tstat word bdec(2) tdec(2) replace

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net thorn-barroso, fe


* #2: Add EU-level political variables
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 ctr* thorn-barroso 
outreg2 using appC, tstat word bdec(2) tdec(2) append

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 thorn-barroso, fe  
		

* #3: Add domestic political variables
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.center l.right ctr* thorn-barroso   
outreg2 using appC, tstat word bdec(2) tdec(2) append

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.center l.right thorn-barroso, fe   


* #4: All variables together
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 l.center l.right ctr* thorn-barroso   
outreg2 using appC, tstat word bdec(2) tdec(2) append

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 l.center l.right thorn-barroso, fe  
		
		

*****************
***** Appendix D. EU treaty fixed effects // Treaty of Rome serves as reference 
*****************

*** European treaties // coded from https://europa.eu/european-union/law/treaties_en; dates used "entered into force"
gen treaty=.
replace treaty = 0 if year<=1986 // Rome treaty 
replace treaty = 1 if year==1987 // Single European Act entered into force July 1 1987
replace treaty = 1 if year==1988 
replace treaty = 1 if year==1989  
replace treaty = 1 if year==1990
replace treaty = 1 if year==1991
replace treaty = 1 if year==1991
replace treaty = 1 if year==1992
replace treaty = 1 if year==1993
replace treaty = 2 if year==1994 // Maastrict treaty entered into force November 1 1993; we code 1994 as the first year of the Maastrict treaty
replace treaty = 2 if year==1995
replace treaty = 2 if year==1996
replace treaty = 2 if year==1997
replace treaty = 2 if year==1998
replace treaty = 3 if year==1999 // Amsterdam treaty entered into force May 1 1999; we code 1999 as the first year of the Maastrict treaty
replace treaty = 3 if year==2000
replace treaty = 3 if year==2001
replace treaty = 3 if year==2002   
replace treaty = 4 if year==2003 // Nice treaty entered into force Feb 1 2003; we code 2003 as the first year of the Maastrict treaty
replace treaty = 4 if year==2004
replace treaty = 4 if year==2005
replace treaty = 4 if year==2006
replace treaty = 4 if year==2007
replace treaty = 4 if year==2008
replace treaty = 4 if year==2009
replace treaty = 5 if year==2010 // Lisbon treaty entered into force December 1 2009; we code 2010 as the first year of the Maastrict treaty
replace treaty = 5 if year==2011
replace treaty = 5 if year==2012
replace treaty = 5 if year==2013   
replace treaty = 5 if year==2014 

tab treaty

* #1
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net ctr* i.treaty
outreg2 using appD, tstat word bdec(2) tdec(2) replace

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net i.treaty, fe


* #2: Add EU-level political variables
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 ctr* i.treaty
outreg2 using appD, tstat word bdec(2) tdec(2) append

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 i.treaty, fe  
		

* #3: Add domestic political variables
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.center l.right ctr* i.treaty   
outreg2 using appD, tstat word bdec(2) tdec(2) append

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.center l.right i.treaty, fe   


* #4: All variables together
xtpcse OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 l.center l.right ctr* i.treaty  
outreg2 using appD, tstat word bdec(2) tdec(2) append

		* R2, within
		xtreg OBB_GNI l.GNIpercapitaPPSEU15100 l.NationalUnemplymnetrate l.gini_net l.ssi l.govt_per108 l.center l.right i.treaty, fe  


*** End do-file for appendix
